import request from "@/utils/request";


//查询评论列表
export function getComments(params){
    return request({
        url:'/comment/list',
        params:params,
        showSuccessMessage:false,
    })
}

//新增评论
export function addComment(payload){
    return request({
        url:'/comment/add',
        method:'post',
        data:payload
    })
}

//删除评论
export function removeComment(commentId){
    return request({
        url:'/comment/'+commentId,
        method:'delete'
    })
}

//批量删除评论
export function removeCommentBatch(commentIds){
    return request({
        url:'/comment/batch',
        method:'delete',
        data:commentIds
    })
}

//根据商品id查询评论
export function getCommentByProductId(productId,params){
    return request({
        url:'/comment/product/'+productId,
        params:params,
        showSuccessMessage:false,
    })
}

//根据用户id查询评论
export function getCommentByUserId(userId,params){
    return request({
        url:'/comment/user/'+userId,
        params:params,
        showSuccessMessage:false,
    })
}

